import React, { Component } from 'react';
import {RoomDetail,RoomDetailRecomend} from '../body/RoomDetail'
import roomImg from '../../image/room.jpg'
import './adminIndex.css'
import {Link} from 'react-router-dom';
import {Icon,Button,Divider,Modal,Input} from 'antd';
import Head from '../Head';
class AdminIndex extends Component {
    constructor(props) {
        super(props);
        this.state = {
            addRecomendHomeDeatilVisible:false,
            addHotHomeDeatilVisible:false,
            changeHomeDetailVisible:false,
            changeMyDetailVisible:false
        }
    }
    render() {
        return (
            <div className="adminIndex">
                <div className="roomShowTop">
                    <Link to="/app/home/index" style={{color:'#555'}}>
                        <Icon type="left" style={{fontSize:'30px',float:'left'}}/>
                    </Link>
                    管理中心
                </div>
                <Head />
                <Button className="changeButton"
                        onClick={()=>this.setState({
                            changeMyDetailVisible:!this.state.changeMyDetailVisible})}>修改</Button>
                <Divider orientation="left" style={{margin:'0px'}}><span style={{marginRight:'10px'}}>店主推荐</span>
                    <Icon type="plus-circle" theme="filled"
                          onClick={()=>this.setState({
                              addRecomendHomeDeatilVisible:!this.state.addRecomendHomeDeatilVisible})}/></Divider>
                <RoomDetailRecomend img={roomImg} likeCount={100} address="百货中心" price="100" more="好"
                                    recomendText={"此房位于是中心，十个不错的房子，故推荐给大家！"}/>
                <Button className="changeButton" onClick={
                    ()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}>修改</Button>
                <RoomDetailRecomend img={roomImg} likeCount={100} address="百货中心" price="100" more="好"
                                    recomendText={"此房位于是中心，十个不错的房子，故推荐给大家！"}/>
                <Button className="changeButton" onClick={
                    ()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}>修改</Button>
                <Divider orientation="left" style={{margin:'0px'}}><span style={{marginRight:'10px'}}>热门</span>
                    <Icon type="plus-circle" theme="filled"
                          onClick={()=>this.setState({
                              addHotHomeDeatilVisible:!this.state.addHotHomeDeatilVisible})}/></Divider>
                <RoomDetail img={roomImg} likeCount={100} address="百货中心" price="100" more="好"
                            talk={[{"user":"xxx","text":"大大"},{"user":"yyy","text":"好"},]}/>
                <Button className="changeButton" onClick={
                    ()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}>修改</Button>
                <RoomDetail img={roomImg} likeCount={100} address="百货中心" price="100" more="好"
                            talk={[{"user":"xxx","text":"大大"},{"user":"yyy","text":"好"},]}/>
                <Button className="changeButton" onClick={
                    ()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}>修改</Button>
                {/*添加推荐弹出框*/}
                <Modal
                    visible={this.state.addRecomendHomeDeatilVisible}
                    onOk={()=>this.setState({addRecomendHomeDeatilVisible:!this.state.addRecomendHomeDeatilVisible})}
                    okText="确定"
                    cancelText="取消"
                    title="添加推荐"
                    onCancel={()=>this.setState({addRecomendHomeDeatilVisible:!this.state.addRecomendHomeDeatilVisible})}
                >
                </Modal>
                {/*添加热门弹出框*/}
                <Modal
                    visible={this.state.addHotHomeDeatilVisible}
                    onOk={()=>this.setState({addHotHomeDeatilVisible:!this.state.addHotHomeDeatilVisible})}
                    okText="确定"
                    cancelText="取消"
                    title="添加热门"
                    onCancel={()=>this.setState({addHotHomeDeatilVisible:!this.state.addHotHomeDeatilVisible})}
                >
                </Modal>
                {/*修改弹出框*/}
                <Modal
                    visible={this.state.changeHomeDetailVisible}
                    onOk={()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}
                    okText="确定"
                    cancelText="取消"
                    title="修改"
                    onCancel={()=>this.setState({changeHomeDetailVisible:!this.state.changeHomeDetailVisible})}
                >
                </Modal>
                {/*修改个人信息弹出框*/}
                <Modal
                    visible={this.state.changeMyDetailVisible}
                    onOk={()=>this.setState({changeMyDetailVisible:!this.state.changeMyDetailVisible})}
                    okText="确定"
                    cancelText="取消"
                    title="修改个人信息"
                    onCancel={()=>this.setState({changeMyDetailVisible:!this.state.changeMyDetailVisible})}
                >
                    <p className="modalP">
                        <Input addonBefore="店主姓名：" placeholder="潘毅" name="username"/>
                    </p>
                    <p className="modalP">
                        <Input addonBefore="电话：" placeholder="18681262248" name="username"/>
                    </p>
                </Modal>
            </div>
        );
    }
}

export default AdminIndex;
